﻿<%@ Page Language="C#" AutoEventWireup="True" MasterPageFile="~/Templates/MasterPages/Mobile.Master" CodeBehind="EventList.aspx.cs" Inherits="EPiServer.Municipality.Templates.MobilePages.EventList" %>

<asp:Content runat="server" ContentPlaceHolderID="Content">

<div data-role="navbar" class="ui-body-a">
	<ul>
		<li><a href="?mode=week" data-transition="none" <%=GetClass("week") %>>7 dagar</a></li>
		<li><a href="?mode=month" data-transition="none" <%=GetClass("month") %>>30 dagar</a></li>
		<li><a href="?mode=year" data-transition="none" <%=GetClass("year") %>>365 dagar</a></li>
	</ul>

<h5 class="ui-body"><%=GetEventCount() %> <%=GetEventDatePeriod() %></h5>

</div>

<EPiServer:EventPagedList runat="server" ID="EventRepeater" SortBy="desc">

   <HeaderTemplate>
        <ul data-role="listview">
   </HeaderTemplate>
   
    <EventHeadingTemplate>
        <li data-role="list-divider"><%#((DateTime)Container.CurrentDate).ToString("dddd, dd MMMM, yyyy")%><span class="ui-li-count ui-btn-up-c ui-btn-corner-all"><%#Container.CurrentPageDataCollection.Count()%></span></li>
    </EventHeadingTemplate>
    
    <ItemTemplate>
    
    <asp:Repeater runat="server" DataSource="<%#Container.CurrentPageDataCollection %>">

                <ItemTemplate>
                <li data-icon="custom" data-theme="d">
                    <a href="<%#((EPiServer.Core.PageData)Container.DataItem).LinkURL %>">
                    
                    <p class="ui-li-aside ui-li-desc">
                    <strong><%#GetDate(Container.DataItem)%></strong>
                    </p>
                    
                    <h3 class="smaller"><%#((EPiServer.Core.PageData)Container.DataItem).PageName %></h3>
                    <%#GetIntroText((EPiServer.Core.PageData)Container.DataItem)%>
                    </a>
                    </li>
                </ItemTemplate>
                
            </asp:Repeater>
            
        </ItemTemplate>
        
       <FooterTemplate>
       </ul>
       </FooterTemplate>
       
    <EmptyItemTemplate>Det finns inga evenemang inom 30 dagar.</EmptyItemTemplate>
</EPiServer:EventPagedList>

</asp:Content>